const request = function(url, data, method = "GET") {
	uni.showLoading({
		title: "正在加载..."
	})
	return new Promise((resolve, reject) => {
		uni.request({
			url,
			data: data || {},
			method,
			success: (res) => {
				resolve(res)
			},
			reject: (err) => {
				reject(err)
			},
			complete: () => {
				uni.hideLoading()
			}
		})
	})
}



uni.$request = request
uni.$get = function(url, data) {
	return request(url, data, "GET")
}
uni.$post = function(url, data) {
	return request(url, data, "POST")
}